package com.slz3.business.module.goodsManagement.gooAttributeValue.steward;

import com.slz3.business.module.goodsManagement.gooAttributeValue.domain.GooAttributeValue;
import com.slz3.business.module.goodsManagement.gooAttributeValue.domain.GooAttributeValueCondition;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

@Component
public class GooAttributeValueResponse {

    @Autowired
    private GooAttributeValueResController gooAttributeValueResController;

    public Mono<ServerResponse> add(ServerRequest req) {
        return req.bodyToMono(GooAttributeValue.class).flatMap(gooAttributeValue ->
                gooAttributeValueResController.add(req, gooAttributeValue)
        );
    }

    public Mono<ServerResponse> delete(ServerRequest req) {
        return req.bodyToMono(GooAttributeValueCondition.class).flatMap(gooAttributeValueCondition ->
                gooAttributeValueResController.delete(req, gooAttributeValueCondition)
        );
    }

    public Mono<ServerResponse> modify(ServerRequest req) {
        return req.bodyToMono(GooAttributeValue.class).flatMap(gooAttributeValue ->
                gooAttributeValueResController.modify(req, gooAttributeValue)
        );
    }


    public Mono<ServerResponse> list(ServerRequest req) {
        return gooAttributeValueResController.list(req);
    }

    public Mono<ServerResponse> info(ServerRequest req) {
        return gooAttributeValueResController.info(req);
    }

    public Mono<ServerResponse> choice(ServerRequest req) {
        return gooAttributeValueResController.choice(req);
    }

    public Mono<ServerResponse> auditSubmit(ServerRequest req) {
        return req.bodyToMono(GooAttributeValueCondition.class).flatMap(gooAttributeValueCondition ->
                gooAttributeValueResController.auditSubmit(req, gooAttributeValueCondition)
        );
    }

    public Mono<ServerResponse> audit(ServerRequest req) {
        return req.bodyToMono(GooAttributeValueCondition.class).flatMap(gooAttributeValueCondition ->
                gooAttributeValueResController.audit(req, gooAttributeValueCondition)
        );
    }

    public Mono<ServerResponse> auditReject(ServerRequest req) {
        return req.bodyToMono(GooAttributeValueCondition.class).flatMap(gooAttributeValueCondition ->
                gooAttributeValueResController.auditReject(req, gooAttributeValueCondition)
        );
    }

    public Mono<ServerResponse> usingEnable(ServerRequest req) {
        return req.bodyToMono(GooAttributeValueCondition.class).flatMap(gooAttributeValueCondition ->
                gooAttributeValueResController.usingEnable(req, gooAttributeValueCondition)
        );
    }

    public Mono<ServerResponse> usingDisable(ServerRequest req) {
        return req.bodyToMono(GooAttributeValueCondition.class).flatMap(gooAttributeValueCondition ->
                gooAttributeValueResController.usingDisable(req, gooAttributeValueCondition)
        );
    }

}
